package sv.gob.mh.dgii.model;
// Generated Sep 29, 2008 11:15:30 AM by Hibernate Tools 3.2.0.CR1


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TbDocIdentidad generated by hbm2java
 */
@Entity
@Table(name="TB_DOC_IDENTIDAD"
    ,schema="CATALOGOS"
)
public class TbDocIdentidad  implements java.io.Serializable {


     /**
	 * 
	 */
	private static final long serialVersionUID = 4707772239853118634L;
	private String cdocIdentidad;
     private TbClaseContrib tbClaseContrib;
     private String cusuario;
     private String ddocIdentidad;
     private Date fhingreso;
     private Integer bstatus;
     private Integer bdesplegable;
     private Integer bimpresion;
     private String sabrevia;
     private Set<RcDocIdentidad> rcDocIdentidads = new HashSet<RcDocIdentidad>(0);
     private Set<CcSolEntrega> ccSolEntregas = new HashSet<CcSolEntrega>(0);

    public TbDocIdentidad() {
    }
    public TbDocIdentidad(String cdocIdentidad) {
    	this.cdocIdentidad = cdocIdentidad;
    }

	
    public TbDocIdentidad(String cdocIdentidad, String cusuario, String ddocIdentidad, Date fhingreso, Integer bstatus, Integer bdesplegable, Integer bimpresion) {
        this.cdocIdentidad = cdocIdentidad;
        this.cusuario = cusuario;
        this.ddocIdentidad = ddocIdentidad;
        this.fhingreso = fhingreso;
        this.bstatus = bstatus;
        this.bdesplegable = bdesplegable;
        this.bimpresion = bimpresion;
    }
    public TbDocIdentidad(String cdocIdentidad, TbClaseContrib tbClaseContrib, String cusuario, String ddocIdentidad, Date fhingreso, Integer bstatus, Integer bdesplegable, Integer bimpresion, String sabrevia, Set<RcDocIdentidad> rcDocIdentidads, Set<CcSolEntrega> ccSolEntregas) {
       this.cdocIdentidad = cdocIdentidad;
       this.tbClaseContrib = tbClaseContrib;
       this.cusuario = cusuario;
       this.ddocIdentidad = ddocIdentidad;
       this.fhingreso = fhingreso;
       this.bstatus = bstatus;
       this.bdesplegable = bdesplegable;
       this.bimpresion = bimpresion;
       this.sabrevia = sabrevia;
       this.rcDocIdentidads = rcDocIdentidads;
       this.ccSolEntregas = ccSolEntregas;
    }
   
     @Id 
    
    @Column(name="C_DOC_IDENTIDAD", unique=true, nullable=false, length=2)
    public String getCdocIdentidad() {
        return this.cdocIdentidad;
    }
    
    public void setCdocIdentidad(String cdocIdentidad) {
        this.cdocIdentidad = cdocIdentidad;
    }
@ManyToOne(fetch=FetchType.EAGER)
    @JoinColumn(name="C_CLASE")
    public TbClaseContrib getTbClaseContrib() {
        return this.tbClaseContrib;
    }
    
    public void setTbClaseContrib(TbClaseContrib tbClaseContrib) {
        this.tbClaseContrib = tbClaseContrib;
    }
    
    @Column(name="C_USUARIO", nullable=false, length=30)
    public String getCusuario() {
        return this.cusuario;
    }
    
    public void setCusuario(String cusuario) {
        this.cusuario = cusuario;
    }
    
    @Column(name="D_DOC_IDENTIDAD", nullable=false, length=50)
    public String getDdocIdentidad() {
        return this.ddocIdentidad;
    }
    
    public void setDdocIdentidad(String ddocIdentidad) {
        this.ddocIdentidad = ddocIdentidad;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="FH_INGRESO", nullable=false, length=7)
    public Date getFhingreso() {
        return this.fhingreso;
    }
    
    public void setFhingreso(Date fhingreso) {
        this.fhingreso = fhingreso;
    }
    
    @Column(name="B_STATUS", nullable=false, precision=1, scale=0)
    public Integer getBstatus() {
        return this.bstatus;
    }
    
    public void setBstatus(Integer bstatus) {
        this.bstatus = bstatus;
    }
    
    @Column(name="B_DESPLEGABLE", nullable=false, precision=1, scale=0)
    public Integer getBdesplegable() {
        return this.bdesplegable;
    }
    
    public void setBdesplegable(Integer bdesplegable) {
        this.bdesplegable = bdesplegable;
    }
    
    @Column(name="B_IMPRESION", nullable=false, precision=1, scale=0)
    public Integer getBimpresion() {
        return this.bimpresion;
    }
    
    public void setBimpresion(Integer bimpresion) {
        this.bimpresion = bimpresion;
    }
    
    @Column(name="S_ABREVIA", length=6)
    public String getSabrevia() {
        return this.sabrevia;
    }
    
    public void setSabrevia(String sabrevia) {
        this.sabrevia = sabrevia;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="tbDocIdentidad")
    public Set<RcDocIdentidad> getRcDocIdentidads() {
        return this.rcDocIdentidads;
    }
    
    public void setRcDocIdentidads(Set<RcDocIdentidad> rcDocIdentidads) {
        this.rcDocIdentidads = rcDocIdentidads;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="tbDocIdentidad")
    public Set<CcSolEntrega> getCcSolEntregas() {
        return this.ccSolEntregas;
    }
    
    public void setCcSolEntregas(Set<CcSolEntrega> ccSolEntregas) {
        this.ccSolEntregas = ccSolEntregas;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 61 * hash + (this.cdocIdentidad != null ? this.cdocIdentidad.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final TbDocIdentidad other = (TbDocIdentidad) obj;
        if ((this.cdocIdentidad == null) ? (other.cdocIdentidad != null) : !this.cdocIdentidad.equals(other.cdocIdentidad)) {
            return false;
        }
        return true;
    }




}


